#!/bin/bash
supervisorctl stop iot-client
rm -f /etc/supervisord.d/iot-client.ini
supervisorctl reload 2>&1 > /dev/null
systemctl restart supervisord
crontab /dev/null
if [ -f "/usr/local/src/jdk-8u161-linux-x64.tar.gz" ];then
    rm -f /usr/local/src/jdk-8u161-linux-x64.tar.gz
fi
if [ -d /root/logs/iot ];then
    rm -rf /root/logs/iot
fi
if [ -d /data/app ];then
    rm -rf /data/app
fi
if [ -f "/usr/local/src/iotClientInstaller.tar.gz" ];then
    rm -f /usr/local/src/iotClientInstaller.tar.gz
fi
if [ -d "/opt/jdk1.8.0_161" ];then
    rm -rf /opt/jdk1.8.0_161
fi
chmod 644 /etc/inittab
echo "Success"
